// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLAlterTableRenameIndex.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"

SQLAlterTableRenameIndex::SQLAlterTableRenameIndex(SQLName_ptr name, SQLName_ptr to)
{
  this->setName(name);
  this->setTo(to);
}

SQLAlterTableRenameIndex::SQLAlterTableRenameIndex()
{
}

void SQLAlterTableRenameIndex::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableRenameIndex)))
  {
    acceptChild(visitor, name);
    acceptChild(visitor, to);
  }
  visitor->endVisit(SharedObject(SQLAlterTableRenameIndex));
}

SQLName_ptr SQLAlterTableRenameIndex::getName()
{
  return name;
}

void SQLAlterTableRenameIndex::setName(SQLName_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLAlterTableRenameIndex));
  }
  this->name = x;
}

SQLName_ptr SQLAlterTableRenameIndex::getTo()
{
  return to;
}

void SQLAlterTableRenameIndex::setTo(SQLName_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLAlterTableRenameIndex));
  }
  this->to = x;
}
